<?php

/* @var $this yii\web\View */

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;
use app\models\SysConfig;
//use app\assets\SmartWizardAsset;
//SmartWizardAsset::register($this);
if($model->channel==1){
?>
<form name='easepay' id='easepay' method='post' action='https://pay.yizhifubj.com/prs/user_payment.checkit' target='_blank'>
  <input type='hidden' name='v_mid' value='<?=$payease['v6_mid']?>'>
  <!--日期-商户号-商户流水号（每日不可重复）-->
  <input type='hidden' name='v_oid' id='easepay-void' value='<?=$payease['v5_oid']?>'>
  <input type='hidden' name='v_rcvname' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_rcvaddr' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_rcvtel' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_rcvpost' value='<?=$payease['v4_rcvname']?>'>
  <input type='hidden' name='v_amount' value='<?=$payease['v3_amount']?>'>
  <!--日期-yyyymmdd-->
  <input type='hidden' name='v_ymd' value='<?=$payease['v2_ymd']?>'>
  <input type='hidden' name='v_orderstatus' value='1'>
  <input type='hidden' name='v_ordername' value='<?=$payease['v4_rcvname']?>'>
  <!--0-人民币-->
  <input type='hidden' name='v_moneytype' value='<?=$payease['v1_moneytype']?>'>
  <input type='hidden' name='v_url' value='<?=$payease['v7_url']?>'>
  <input type='hidden' name='v_md5info' value='<?=$payease['sign']?>'>

</form>


<?php } ?>

<div class='container' style='margin-bottom:100px;'>
  <div class='center-block' style='padding:50px 0;'>

    <h2 style='text-align:center;'><i class="fa fa-rmb"></i> <?=number_format($model->money,2)?></h2>
    <br>
    <?php
    if($model->channel!=1){
    ?>
    <img src='<?=Url::toRoute(['site/qrcode','qrid'=>$deal->id,'rand'=>time()])?>' class='img-responsive center-block congzhi-qrcode'/>
    <br>
    <?php } ?>
    <?php
    //微信
    $scantext='';
    if($model->channel==1){
      $scantext='请在首信易支付页面完成实际充值';
    }
    else if($model->channel==2){
      $scantext='请使用支付宝扫描二维码以完成充值';
    }else if($model->channel==3){
      $scantext='请使用微信扫描二维码以完成充值';
    }else{

    }
    ?>
    <?php
    if($model->channel!=1){
    ?>
    <div style='display:flex;flex-direction:row;justify-content:center'>
    <img src='<?=Url::toRoute('images/scan.png')?>'  style='width:48px;height:48px;' class='img-responsive' />
    <div style='font-size:16px;max-width:150px;margin-left:10px;'><?=$scantext?></div>
    </div>
  <?php }else{
    echo '<div style="display:flex;flex-direction:row;justify-content:center">';
    echo '<div style="font-size:16px;max-width:150px;margin-left:10px;">'.$scantext.'</div>';
    echo "</div>";
  } ?>
    <table class="table table-striped detail-view" id="w0" style='max-width:500px;margin:10px auto;'>
      <tbody>
        <tr><th style='text-align:left;'>商家</th><td style='text-align:right;'>贝恩资本</td></tr>
        <tr><th style='text-align:left;'>商品名称</th><td style='text-align:right;'><?=$this->context->user->name ?>账户充值</td></tr>
        <tr><th style='text-align:left;'>支付通道</th><td style='text-align:right;' id='deal-channel' channel='<?=$model->channel?>'><?php
        if($model->channel==1){
          echo '网银（首信易）';
        }else if($model->channel==2){
          echo '支付宝';
        }else if($model->channel==3){
          echo '微信支付';
        }else{
          echo '非法通道';
        }
        ?></td></tr>
        <tr><th style='text-align:left;'>交易单号</th><td style='text-align:right;' id='order-no'><?=$model->orderno?></td></tr>
        <tr><th style='text-align:left;'>创建时间</th><td style='text-align:right;'><?=$deal->reg_dt?></td></tr>
      </tbody>
    </table>
  </div>
</div>

<!-- Modal -->
<div class="modal fade" id="congzhi-result" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog modal-lg" role="document">
    <div class="modal-content">
      <div class="modal-header btn-warning">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><i class="fa fa-legal"></i> 充值结果</h4>

      </div>
      <div class="modal-body">
        <h3 class="page-header"><i class="fa fa-exclamation alert-info"></i> <span id='result-text'>充值成功！</span></h3>
        <p><b>5秒后跳转到充值起始页面，<a href='<?=Url::toRoute('site/wizardcongzhi')?>'>点此立即跳转</a></b></p>
      </div>
    </div>
  </div>
</div>
